<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
        <meta charset="UTF-8">
        <title>增加管理员信息</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <link rel="stylesheet" href="../css/font.css">
        <link rel="stylesheet" href="../css/xadmin.css">
        <script type="text/javascript" src="../js/jquery.min.js"></script>
        <script src="../lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="../js/xadmin.js"></script>
        <script src="../js/admin-add.js" charset="utf-8"></script>
    </head>
    <body>
        <div class="layui-fluid" style="width: 600px;margin-top: 30px;">
            <div class="layui-row">
                <form class="layui-form">
                  <div class="layui-form-item">
                      <label class="layui-form-label">
                          <span class="x-red">*</span>管理员名字
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="yhm" name="username" required="" lay-verify="required"
                          autocomplete="off" class="layui-input">
                      </div>
                      <div class="layui-form-mid layui-word-aux">
                          <span class="x-red">*</span>
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label class="layui-form-label">
                          <span class="x-red">*</span>手机
                      </label>
                      <div class="layui-input-inline">
                          <input type="text" id="dh" name="phone" required="" lay-verify="phone"
                          autocomplete="off" class="layui-input">
                      </div>
                      <div class="layui-form-mid layui-word-aux">
                          <span class="x-red">*</span>
                      </div>
                  </div>
				  <div class="layui-form-item">
				      <label class="layui-form-label">
				          <span class="x-red">*</span>性别
				      </label>
				      <div class="layui-input-inline">
				          <input type="text" id="xb" name="phone" required="" lay-verify="phone"
				          autocomplete="off" class="layui-input">
				      </div>
				      <div class="layui-form-mid layui-word-aux">
				          <span class="x-red">*</span>
				      </div>
				  </div>
				  <div class="layui-form-item">
				      <label class="layui-form-label">
				          <span class="x-red">*</span>年龄
				      </label>
				      <div class="layui-input-inline">
				          <input type="text" id="nl" name="phone" required="" lay-verify="phone"
				          autocomplete="off" class="layui-input">
				      </div>
				      <div class="layui-form-mid layui-word-aux">
				          <span class="x-red">*</span>
				      </div>
				  </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="x-red">*</span>角色</label>
                        <div class="layui-input-block">
                            <input type="radio" name="admin" value="1" title="管理员">
                            <input type="radio" name="admin" value="2" title="超级管理员" checked>
                        </div>
                    </div>
                  <div class="layui-form-item">
                      <label class="layui-form-label">
                          <span class="x-red">*</span>密码
                      </label>
                      <div class="layui-input-inline">
                          <input type="password" id="mm" name="pass" required="" lay-verify="pass"
                          autocomplete="off" class="layui-input">
                      </div>
                      <div class="layui-form-mid layui-word-aux">
                          5到16个字符
                      </div>
                  </div>
                  <div class="layui-form-item">
                      <label class="layui-form-label">
                          <span class="x-red">*</span>确认密码
                      </label>
                      <div class="layui-input-inline">
                          <input type="password" id="qrmm" name="repass" required="" lay-verify="repass"
                          autocomplete="off" class="layui-input">
                      </div>
                  </div>
                </form>
                  <div class="layui-form-item">
                      <label  class="layui-form-label">
                      </label>
                      <button  class="layui-btn" id="qd">
                          确定
                      </button>
					  <button style="margin-left: 90px;"  class="layui-btn" id="qk">
					      清空
					  </button>
                  </div>

            </div>
        </div>
    </body>
</html>
<script>
    layui.use(['form', 'layer'], function() {
        $ = layui.jquery;
        var form = layui.form,
            layer = layui.layer;

        //监听提交
        form.on('submit(add)',
            function(data) {
                console.log(data);
                //发异步，把数据提交给php
                layer.alert("增加成功", {
                        icon: 6
                    },
                    function() {
                        //关闭当前frame
                        xadmin.close();

                        // 可以对父窗口进行刷新
                        xadmin.father_reload();
                    });
                return false;
            });

    });
</script>
<script>
    $("body").keydown(function () {
        if (event.keyCode == "13") {//keyCode=13是回车键
            $("#qd").click();
        }
    });
</script>
